#ifndef CLIENT_HPP
#define CLIENT_HPP

#include <QObject>
#include <QList>
#include <QFile>
#include <QtNetwork/QSslSocket>
#include <QtNetwork/QSslKey>
#include <QString>
#include <QCloseEvent>
#include "packagemanager.hpp"

class Client : public QObject
{
    Q_OBJECT

private:
    QSslSocket client;
    QString localCertificate;
    QString privateKey;
    
    QString name;
    bool logged;

public:
    Client();
    Client(QString, quint16); // Address and port

    ~Client();

    void start(QString, quint16);
    virtual void fnAuthentificationOK();
    
    void emitAuthentificationFail();
    void emitAuthentificationDouble();
    void emitAuthentificationOK();


signals:
    void authentificationFail();
    void authentificationDouble();
    void authentificationOK();

public slots:
    void connection();
    void read(); // Calls when client is ready to read

    // Calls when button "connexion" is clicked on client's GUI
    void buttonConnection(QString, QString);

    // Ecg module
    void buttonEcg();


};

#endif // CLIENT_HPP
